﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string filePath = Server.MapPath("files/myFile.txt");
        FileInfo fileInfo = new FileInfo(filePath);
        {
            if (fileInfo.Exists == false)
            {
                fileInfo.Create();
            }
        }

        using (StreamWriter streamWriter = File.AppendText(filePath))
        {
            streamWriter.WriteLine(DateTime.Now.ToString());
        }
    }
}
